package cn.melon.view.admin.course.ctr;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import cn.melon.mod.sc.ScInfo;
import cn.melon.mod.sc.ScRequest;
import cn.melon.view.admin.course.CourseInfoDlg;
import cn.melon.view.admin.course.IUpdateCourseTable;

public class CourseInfoDlgCtr implements ActionListener{
    
    private CourseInfoDlg dialog = null;
    private ScRequest request;
    
    public CourseInfoDlgCtr(CourseInfoDlg dlg, IUpdateCourseTable updateCourseTable){
        this.dialog = dlg;
        request = new ScRequest(updateCourseTable);
    }
    
    @Override
    public void actionPerformed(ActionEvent e) {
        System.out.println("In DormInfoDlg");
        switch (e.getActionCommand()) {
        case "保存":
            ScInfo info = dialog.getScInfo();
            request.changeInfo(info);

            dialog.setVisible(false);
            break;
        case "取消":
            dialog.setVisible(false);
            break;
        default:
            break;
        }

    }


}
